/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package address;

import equipment.Equipment;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 *
 * @author PC
 */
@Entity
@Table(name="ADDRESSES")
public class Addresses implements java.io.Serializable {
    private static final long serialVersionUID = -8667337896773261247L;
 
    private int id_address;
    private String interface_addr;
    private String address ;
    private String netmask;
    private String type_address;
    private Equipment equipment;

    public Addresses() {
    }
    
    public Addresses(int id_address, String interface_addr, String address, String netmask, String type_address){
        this.id_address = id_address;
        this.interface_addr = interface_addr;
        this.address = address;
        this.netmask = netmask;
        this.type_address = type_address;
    }
    
    public Addresses(int id_address, String interface_addr, String address){
        this.id_address = id_address;
        this.interface_addr = interface_addr;
        this.address = address;
    }
 
    @Id
    @GeneratedValue
    @Column(name="ID_ADDRESS")
    public int getId_address() {
        return id_address;
    }
    
    @Column(name="INTERFACE_ADDR")
    public String getName_hardware() {
        return interface_addr;
    }
 
    @Column(name="ADDRESS")
    public String getAddress() {
        return address;
    }
  
     @Column(name="NETMASK")
    public String getNetmask() {
        return netmask;
    }
    
    @Column(name="TYPE_ADDRESS")
    public String getType_address() {
        return type_address;
    }

    public void setId_address(int id_address) {
        this.id_address = id_address;
    }  

    public void setInterface_addr(String interface_addr) {
        this.interface_addr = interface_addr;
    }

    public void setAddress(String address) {
        this.address = address;
    }
    
    public void setNetmask(String netmask) {
        this.netmask = netmask;
    }

    public void setType_address(String type_address) {
        this.type_address = type_address;
    } 
    
    @ManyToOne
    @JoinColumn(name="id_equipment")
    public Equipment getEquipment() {
        return equipment;
    }

    public void setEquipment(Equipment equipment) {
        this.equipment = equipment;
    } 

    @Override
    public String toString() {
        return "AddressIp{" + "id_address=" + id_address + ", interface=" + interface_addr + ", address=" + address + ", netmask=" + netmask + ", type_address=" + type_address + '}';
    }
}
